﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using AutoMapper;
using Sharp.DataTransferObject;
using Sharp.DataTransferObject.Workflow;
using Sharp.WebBooter.Areas.Platform.Models;

namespace Sharp.WebBooter.Areas.Platform
{
    public class AutoMapperProfile : Profile
    {
        public AutoMapperProfile()
        {
            #region 用户

            this.CreateMap<UserDTO, UserViewModel>()
                .ReverseMap();
            this.CreateMap<UserProfileDTO, UserViewModel.UserProfileViewModel>()
                .ReverseMap();

            this.CreateMap<RoleDTO, RoleViewModel>()
                .ReverseMap();
            this.CreateMap<PermissionDTO, PermissionViewModel>()
                .ReverseMap();
            this.CreateMap<AvailablePermissionIndexViewModel, PermissionDTO>();
            this.CreateMap<PermissionDTO, AvailablePermissionIndexViewModel>();
            #endregion


            this.CreateMap<PersonDTO, EmployeeModel>()
                          .ReverseMap();
            this.CreateMap<EmployeeDTO, EmployeeModel>()
                          .ReverseMap();
            this.CreateMap<OrgDTO, OrgViewModel>()
                .ReverseMap();
            this.CreateMap<OrgDTO, OrgIndexViewModel>()
                .ReverseMap();
            this.CreateMap<OrgLevelDTO, OrgLevelModel>()
                .ReverseMap();
            this.CreateMap<JobDTO, JobModel>()
                .ReverseMap();
            this.CreateMap<GroupDTO, GroupModel>()
                .ReverseMap();
            this.CreateMap<MasterDataDTO, MasterDataModel>()
                .ReverseMap();
            this.CreateMap<SubSystemDTO, SubSystemModel>()
                .ReverseMap();
            this.CreateMap<MessageDTO, MessageModel>()
                .ReverseMap();

        }
    }
}